package lab02.test20;

import java.util.Scanner;

public class Test20 {
    public static void main(String[] args) {
        //用户从键盘输入一行含有数字和字符的字符串，程序仅仅输出字符串中的全部数字字符。

        Scanner strings = new Scanner(System.in);
        System.out.print("请输入字符串：");
        String string = strings.nextLine();
        for (int i = 0;i < string.length();i++) {
            char temp = string.charAt(i);
            if (temp >= '0' && temp <= '9') {
                System.out.print(temp);
            }
        }
    }
}
